﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Runtime.InteropServices.Automation;

namespace SilverlightTestApp
{
	public partial class MainPage : UserControl
	{
		public MainPage()
		{
			// Required to initialize variables
			InitializeComponent();
		}

		private void Button_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
		{
			System.Windows.MessageBox.Show("This is a test");
		}

		private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
		{
			App.Test();
			try {
			using( dynamic ISpeechVoice = AutomationFactory.CreateObject("SAPI.SpVoice") )
			{
				ISpeechVoice.Volume = 100;
				ISpeechVoice.Speak("Hello World! My Hovercraft is full of eels.");
			}
			}
			catch(Exception ex)
			{
				MessageBox.Show("Trying to create object Exception: " + ex.Message);
			}
		}
	}
}